package com.ruoyi.web.controller.net;

import com.ruoyi.net.domain.BusiMplstpRouteTableListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.net.domain.BusiMplstpRouteTable;
import com.ruoyi.net.service.IBusiMplstpRouteTableService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 业务-mplstp路由表Controller
 * 
 * @author net
 * @date 2024-12-25
 */
@Api(tags = "业务-mplstp路由表")
@RestController
@RequestMapping("/busi/mplstp/route/table")
public class BusiMplstpRouteTableController extends BaseController
{
    @Autowired
    private IBusiMplstpRouteTableService busiMplstpRouteTableService;

    /**
     * 查询业务-mplstp路由表列表
     */
    @ApiOperation(value = "查询业务-mplstp路由表列表", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:table:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusiMplstpRouteTable busiMplstpRouteTable)
    {
        startPage();
        List<BusiMplstpRouteTableListVo> list = busiMplstpRouteTableService.selectBusiMplstpRouteTableList(busiMplstpRouteTable);
        return getDataTable(list);
    }

    /**
     * 导出业务-mplstp路由表列表
     */
    @ApiOperation(value = "导出业务-mplstp路由表列表", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:table:export')")
    @Log(title = "业务-mplstp路由表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusiMplstpRouteTable busiMplstpRouteTable)
    {
        List<BusiMplstpRouteTableListVo> list = busiMplstpRouteTableService.selectBusiMplstpRouteTableList(busiMplstpRouteTable);
        ExcelUtil<BusiMplstpRouteTableListVo> util = new ExcelUtil<BusiMplstpRouteTableListVo>(BusiMplstpRouteTableListVo.class);
        util.exportExcel(response, list, "业务-mplstp路由表数据");
    }

    /**
     * 获取业务-mplstp路由表详细信息
     */
    @ApiOperation(value = "获取业务-mplstp路由表详细信息", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:table:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(busiMplstpRouteTableService.selectBusiMplstpRouteTableById(id));
    }

    /**
     * 新增业务-mplstp路由表
     */
    @ApiOperation(value = "新增业务-mplstp路由表", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:table:add')")
    @Log(title = "业务-mplstp路由表", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusiMplstpRouteTable busiMplstpRouteTable)
    {
        return toAjax(busiMplstpRouteTableService.insertBusiMplstpRouteTable(busiMplstpRouteTable));
    }

    /**
     * 修改业务-mplstp路由表
     */
    @ApiOperation(value = "修改业务-mplstp路由表", httpMethod = "PUT")
    @PreAuthorize("@ss.hasPermi('net:table:edit')")
    @Log(title = "业务-mplstp路由表", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BusiMplstpRouteTable busiMplstpRouteTable)
    {
        return toAjax(busiMplstpRouteTableService.updateBusiMplstpRouteTable(busiMplstpRouteTable));
    }

    /**
     * 删除业务-mplstp路由表
     */
    @ApiOperation(value = "删除业务-mplstp路由表", httpMethod = "DELETE")
    @PreAuthorize("@ss.hasPermi('net:table:remove')")
    @Log(title = "业务-mplstp路由表", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(busiMplstpRouteTableService.deleteBusiMplstpRouteTableByIds(ids));
    }
}
